
import React, { Component } from 'react';


import  {
	View,
	Text,
	Image,StyleSheet,
	TouchableOpacity
} from 'react-native';

import Login from './Login';


const  styles = StyleSheet.create({
	red:{
		color:'red',
	}

});


class Splash extends React.Component {

	//构造方法
	constructor(props){
		super(props);

		this.state = {showText:true};

		setInterval(()=>{
			this.setState({showText:!this.state.showText});
		},1000)

	}

	_openPage() {
		//导航
		this.props.navigator.push({
			title: '登录',
			component: Login
		})

	}
	render() {
		let pic = {uri: 'http://g.hiphotos.baidu.com/image/h%3D200/sign=12a5af3e92eef01f52141fc5d0ff99e0/fd039245d688d43f21be87a87b1ed21b0ef43b50.jpg'};

		return (
			<View style={{ flex: 1, alignItems: 'center', backgroundColor: '#FFFFFF',
							flex: 1,
							flexDirection: 'column',
							justifyContent: 'center',
							alignItems: 'center', }}>
				<Text style={styles.red,{flex:1}}>这是启动页</Text>

				<TouchableOpacity onPress={this._openPage.bind(this)}>
					<Text style={styles.red}>打开新的页面</Text>
				</TouchableOpacity>
				<Image
				source={pic} style={{width:100, height:100}}></Image>
			</View>
		);
	}
}




export default Splash;